import request from '@/utils/request'

export function getAllUserInfo(pageNum) {
  return request({
    url: '/users/info',
    method: 'GET',
    params: { pageNum }
  })
}

export function getUserInfo_name(name) {
  return request({
    url: '/users/searchByName',
    method: 'GET',
    params: { name }
  })
}

export function getUserInfo_uid(uid) {
  return request({
    url: '/users/searchByUid',
    method: 'GET',
    params: { uid }
  })
}
export function editUser(data) {
  return request({
    url: '/users/updateRoles',
    method: 'POST',
    data
  })
}

export function saveUser(data) {
  return request({
    url: '/users/addUser',
    method: 'POST',
    data
  })
}

export function delUser(uid) {
  return request({
    url: '/users/deleteUser',
    method: 'GET',
    params: { uid }
  })
}
